﻿using System;
using System.Web;
using Yglu.BusinessLayer;
using Yglu.BusinessLayer.Entities;

namespace Yglu.WebAdmin
{
	public class LogManager
	{
		#region Methods

		public static void Insert(String message)
		{
			AdminLog log = new AdminLog();

			log.User = SessionManager.LoggedUser;
			log.Message = message;
			log.Page = HttpContext.Current.Request.Path;

			try
			{
				DataAccess.AdminLog_Insert(log);
			}
			catch (Exception ex)
			{
				ErrorManager.Log(ex, Resources.Messages.ErrorCouldNotSaveLog.Replace("#PAGE#", HttpContext.Current.Request.Path));
			}
		}

		#endregion
	}
}